package com.smartleanx.module.hrm.dal.mysql.employee;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.smartleanx.framework.mybatis.core.mapper.BaseMapperX;
import com.smartleanx.module.hrm.dal.dataobject.employee.EmployeeCertificateDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 员工证书 Mapper
 *
 * @author 精益大师
 */
@Mapper
public interface EmployeeCertificateMapper extends BaseMapperX<EmployeeCertificateDO> {

    default List<EmployeeCertificateDO> getEmployeeCertificateList(Long employeeId) {
        return selectList(new LambdaQueryWrapper<EmployeeCertificateDO>()
                .eq(EmployeeCertificateDO::getEmployeeId, employeeId)
                .orderByDesc(EmployeeCertificateDO::getSort));
    }
}
